home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_courtyardcommie2.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  142 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_CourtyardCommmie2.cog
  4. # This cog is based on the brilliant groundbreaking cog work pioneered by Reed Derleth
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     arrived
  15.     message     damaged
  16.     message     user4
  17.     
  18.     thing       player          local
  19.     cog         targetcog       
  20.     
  21.     thing       commie0         linkid=5    mask=0x409
  22.     thing       commie1         linkid=5    mask=0x409
  23.     thing       commie2         linkid=5    mask=0x409
  24.     thing       commie3         linkid=5    mask=0x409
  25.     
  26.     thing       specops0
  27.     thing       specops1
  28.     
  29.     thing       fencedoor
  30.     
  31.     surface     courtflr0       linkid=3
  32.     surface     courtflr1       linkid=3
  33.     surface     courtflr2       linkid=3
  34.     surface     courtflr3       linkid=3
  35.     surface     courtflr4       linkid=3
  36.     surface     courtflr5       linkid=3
  37.     surface     courtflr6       linkid=3
  38.     surface     courtflr7       linkid=3
  39.     surface     courtflr8       linkid=3
  40.     
  41.     sector      archsector
  42.     
  43.     sound       gatestop=tem_ldoorr_ldoorl_close_c.wav  local
  44.     sound       gatesqueal=fol_in_scrapemetal_med.wav   local
  45.     
  46.     int         done=0          local
  47.     int         curframe=0      local
  48.     int         virginal=0      local
  49.     int         x               local
  50.     int         gatechannel     local
  51.         
  52. end
  53.  
  54. code
  55.  
  56. # ========================================================================================
  57. startup:
  58.  
  59.     player = GetLocalPlayerThing();
  60.     
  61.     AISetCutsceneMode(specops0);
  62.     AISetCutsceneMode(specops1);
  63.     
  64.     SetThingFlags(specops0, 0x80000);
  65.     SetThingFlags(specops1, 0x80000);
  66.         
  67.     for (x=0; x<=3; x=x+1)
  68.     {
  69.         AISetCutsceneMode(commie0[x]);
  70.     }
  71.     AISetLookFrame(commie0, 1);
  72.     AISetMoveFrame(commie0, 1);
  73.         
  74. return;
  75.  
  76. #----------------------------------------------------------------------------------------
  77. arrived:
  78.  
  79.     //print("AI hit Waypoint");
  80.     curframe = 1-curframe;
  81.     if ((GetSenderRef() == commie0) && (curframe == 1))
  82.     {
  83.         AISetLookFrame(commie0, 0);
  84.         AIWaitForStop(commie0);
  85.         AISetMoveFrame(commie0, 0);
  86.     }
  87.     
  88.     if ((GetSenderRef() == commie0) && (curframe == 0))
  89.     {
  90.         AISetLookFrame(commie0, 1);
  91.         Sleep(1);
  92.         AISetMoveFrame(commie0, 1);
  93.     }
  94.     
  95. return;
  96.     
  97. #----------------------------------------------------------------------------------------
  98. damaged:
  99.     
  100.     if (virginal == 0)
  101.     {
  102.         SendMessage(targetcog, user0);
  103.         virginal=1;
  104.         for (x=0; x<=3; x=x+1)
  105.         {
  106.             AIClearCutsceneMode(commie0[x]);
  107.         }
  108.         if (GetSectorPlayerCount(archsector) > 0)
  109.         {
  110.             ClearThingFlags(specops0, 0x80000);
  111.             ClearThingFlags(specops1, 0x80000);
  112.         }
  113.         SetCollideType(fencedoor, 0);
  114.         MoveToFrame(fencedoor, 1, 3);
  115.         gatechannel = PlaySoundThing(gatesqueal, fencedoor, 1, 10, 20, 1);
  116.         AIClearCutsceneMode(specops0);
  117.         AIClearCutsceneMode(specops1);
  118.         WaitForStop(fencedoor);
  119.         StopSound(gatechannel, 0);
  120.         SetCollideType(fencedoor, 3);
  121.         PlaySoundThing(gatestop, fencedoor, 1, 10, 20, 0);
  122.     }
  123.     
  124. return;
  125.                 
  126. #----------------------------------------------------------------------------------------
  127. user4:
  128.  
  129.     if (virginal == 1) return;
  130.     
  131.     sleep(5);
  132.     for (x=0; x<=3; x=x+1)
  133.     {
  134.         AIClearCutsceneMode(commie0[x]);
  135.     }
  136.     
  137. return;
  138.  
  139. #----------------------------------------------------------------------------------------
  140.  
  141. end
  142.